

package jetbrains.buildServer.server.graphql.model.connections;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public interface PaginationArguments {
  @Nullable
  public String getAfter();

  public int getCount();

  @NotNull
  public Direction getDirection();

  static PaginationArguments everything() {
    return new PaginationArguments() {
      @Nullable
      @Override
      public String getAfter() {
        return null;
      }

      @Override
      public int getCount() {
        return -1;
      }

      @NotNull
      @Override
      public Direction getDirection() {
        return Direction.FORWARD;
      }
    };
  }

  public enum Direction {
    FORWARD, BACKWARD;
  }
}